package com.qi.demo01.function;

/**
 * @author zjq
 * @date 2020/3/28 21:47
 */

import java.util.function.Consumer;

/**
 * 消费型接口,只有输入，没有返回值，直接用
 */
public class ConsumerDemo {
    public static void main(String[] args) {
//        Consumer<String> consumer = new Consumer<String>(){
//
//            @Override
//            public void accept(String s) {
//                System.out.println(s);
//            }
//        };
//        consumer.accept("asdadad");
        Consumer<String> consumer = (string) -> {
            System.out.println(string);
        };
        consumer.accept("asdadad");
    }
}
